
// Copyright (C) Recursion Company. All rights reserved.

#ifndef __VOL_WTL_IP_EDIT_H__
#define __VOL_WTL_IP_EDIT_H__

class IIPEditEventListener : public IBaseEventListener
{
public:
    virtual void OnChange () = 0;
};

class CVWnd_IPEdit : public CWindowImpl<CVWnd_IPEdit, CIPAddressCtrl>
{
    BEGIN_DECLARE_VOL_NATIVE_WND_CLASS (CVWnd_IPEdit, IIPEditEventListener, TRUE)
        REFLECTED_COMMAND_CODE_HANDLER_EX (EN_SETFOCUS, OnSetFocus)
        REFLECTED_COMMAND_CODE_HANDLER_EX (EN_KILLFOCUS, OnKillFocus)
        REFLECTED_COMMAND_CODE_HANDLER_EX (EN_CHANGE, OnChange)
    END_DECLARE_VOL_NATIVE_WND_CLASS_NOT_CONTAINER ()
    DECLARE_WND_SUPERCLASS (NULL, CIPAddressCtrl::GetWndClassName ())

protected:
    LRESULT OnSetFocus (UINT uNotifyCode, int nID, CWindow wndCtl);
    LRESULT OnKillFocus (UINT uNotifyCode, int nID, CWindow wndCtl);
    LRESULT OnChange (UINT uNotifyCode, int nID, CWindow wndCtl);

public:
    static BOOL_P sCheckIPAddress (const TCHAR* szAddress, INT_P* anIP);

public:
	CVolString m_strIP;
};

#endif
